import request from '@/utils/request'

// 查询配送列表
export function listRider(query) {
  return request({
    url: '/rider/rider/list',
    method: 'get',
    params: query
  })
}


// 查询骑手列表通过仓库
export function getRiderByStorageId(query) {
  return request({
    url: '/rider/rider/getRiderByStorageId',
    method: 'get',
    params: query
  })
}

// 查询配送详细
export function getRider(id) {
  return request({
    url: '/rider/rider/' + id,
    method: 'get'
  })
}

// 新增配送
export function addRider(data) {
  return request({
    url: '/rider/rider',
    method: 'post',
    data: data
  })
}

// 修改配送
export function updateRider(data) {
  return request({
    url: '/rider/rider',
    method: 'put',
    data: data
  })
}

// 删除配送
export function delRider(id) {
  return request({
    url: '/rider/rider/' + id,
    method: 'delete'
  })
}



export function updateBusinessStateToRest(ids) {
  return request({
    url: '/rider/rider/updateBusinessStateToRest',
    method: 'post',
    data: ids
  })
}
export function updateBusinessWorkState(ids) {
  return request({
    url: '/rider/rider/updateBusinessWorkState',
    method: 'post',
    data: ids
  })
}

export function updateStateToAbort(ids) {
  return request({
    url: '/rider/rider/updateStateToAbort',
    method: 'post',
    data: ids
  })
}
export function updateStateToNomral(ids) {
  return request({
    url: '/rider/rider/updateStateToNomral',
    method: 'post',
    data: ids
  })
}


export function getRiderQrcodeImage(data) {
  return request({
    url: '/rider/rider/getRiderQrcodeImage',
    method: 'get',
    params: data
  })
}


// 2023-11-28
// 查询回收员申请列表
export function ApplyList(query) {
  return request({
    url: '/system/huishou/recyclerApply/list',
    method: 'get',
    params: query
  })
}

// 查询回收员申请详细
export function ApplyListDetail(id) {
  return request({
    url: '/system/huishou/recyclerApply/' + id,
    method: 'get'
  })
}

// 修改配送
export function ApplyListEdit(data) {
  return request({
    url: '/system/huishou/recyclerApply/edit',
    method: 'put',
    data: data
  })
}